package com.itheima.service;

import com.itheima.domain.Account;
import com.itheima.mapper.AccountMapper;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("accountService")
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountMapper accountMapper;
    @Override
    @Transactional
    public void save(Account account) {
        accountMapper.save(account);
        int x=3/0;
    }

    @Override
    public List<Account> findAll() {
        List<Account> list = accountMapper.findAll();
        return list;
    }
}
